1. Field of the Invention
The invention relates to a booting method and a computer system therefor, and more particularly to a booting method capable of executing a warm boot or a cold boot when a CPU crash occurs and a computer system therefor.
2. Description of the Related Art
In general, a computer system always provides a hardware reset function and a software reset function to enable the computer system to execute a cold boot and a warm boot, respectively. After the computer system is crashed, a user may choose the hardware reset function or the software reset function to reboot the computer system.
The software reset function is such that a system reset operation is executed by means of software. However, the software reset function is disabled when a CPU (Central Processing Unit) of the computer system is crashed and cannot execute a software instruction. The hardware reset function is such that the reset operation for the computer system is executed by means of hardware. Thus, the hardware reset function is always enabled regardless of whether the CPU is crashed or not. After the software reset function has been executed, the computer system has been warm-booted. That is, the computer system will be rebooted, and the settings and data stored in an SDRAM (Synchronous Dynamic Random Access Memory) of the computer system before the computer system is crashed still exist. After the hardware reset function has been executed, the computer system has been cold-booted. That is, the computer system will be rebooted and return to its default state when it is manufactured, and all the settings and data stored in the SDRAM before the computer system is crashed will be lost.
FIG. 1 is a main architecture diagram showing a conventional computer system. The conventional computer system 100 includes a CPU 102, an SDRAM 104, a software reset generating circuit 106, and a hardware reset generating circuit 108. Data and predefined values for the computer system 100 are stored in the SDRAM 104 controlled by the CPU 102. The software reset generating circuit 106 transfers a software reset signal SR to the CPU 102 to enable the CPU 102 to execute a software reset operation when a user chooses to execute the software reset function. The hardware reset generating circuit 108 transfers a hardware reset signal HR to the CPU 102 to enable the CPU 102 to execute a hardware reset operation when the user chooses to execute the hardware reset function.
FIG. 2 is a flow chart showing a booting method capable of executing a warm boot or a cold boot in a conventional computer system. First, step 202 is performed to judge whether or not the CPU 102 is crashed. If yes, step 204 is performed; and if not, step 206 is performed. In the step 204, the CPU 102 cannot execute the software reset operation because it is crashed. Thus, the user can only choose the hardware reset function. After the step 204, the process goes to step 208, in which the computer system 100 is cold-booted, and all the data and predefined values stored in the SDRAM 104 will be lost.
When the CPU 102 is not crashed, the user may choose the hardware reset function or the software reset function. Thus, in the step 206, the computer system 100 judges that the user chooses the hardware reset function or the software reset function. If the user chooses the software reset function, step 210 is then performed, in which the computer system 100 is warm-booted, and all the data and predefined values stored in the SDRAM 104 will be held. If the user chooses the hardware reset function, step 208 is performed.
The conventional computer system 100 cannot execute the software reset operation but can only execute the hardware reset operation to finish the cold boot when the CPU 102 is crashed. After the computer system 100 is cold-booted, however, the data and the predefined values of the computer system 100 stored in the SDRAM 104 before the computer system is crashed will be completely lost. Then, the user has to set the computer system 100 again, which is quite time-consuming. In addition, important data may be lost, which causes great damage to the user.